﻿
using Base.Common.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Base.WCS.Common
{
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：TaskStatusPersistence                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2021/8/9 8:54:55                        
   *└────────────────────────────────────────────────┘
   **/
    public class TaskStatusPersistence
    {
        public int taskNo { get; set; }
        public int stn { get; set; }
        public int status { get; set; }

        public String errorInfo { get; set; }
        public String taskName { get; set; }
        public BaseTask t;

        public TaskStatusPersistence(int taskNo, int stn, BaseTask t, WcsTaskStatus st, String errorInfo)
        {

             stn = t.getSrc();
            if( st == WcsTaskStatus.执行结束 ) {
                stn = t.getDes();
            }
            this.taskNo = taskNo;
            this.stn = stn;
            this.t = t;
            this.taskName = t?.GetType().Name;
            status = (int)st;
            this.errorInfo = errorInfo;
        }

        public TaskStatusPersistence(int taskNo, int stn, BaseTask t, WcsTaskStatus st) : this(taskNo, stn, t, st, null)
        {

        }
    }
}
